<?php

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
/*权限验证**/


/*请求输入**/


/*请求输出**/
/**
 * json 格式输出结果
 * @param $status
 * @param $info
 * @param array $data
 * @return Response
 */
function json_out ($status,$info,$data = array())
{
    $request = Request::createFromGlobals();
    $access_token = $request->headers->get("access-token");
    $data = array(
        "s"=> $status?$status:0,
        "i"  => $info?$info:"",
        "d"  => $data?$data:"",
    );
    return new Response(json_encode($data),200,array("content-type"=>"application/json","access-token"=>$access_token));
}

